<?php

/**
 * 环信信息发送驱动类
 */
class HXMsg extends Msg{	
	//引用环信类，调用发送方法发送文本信息
	public function sendMsg(){

		$this->user=$this->user==$this->touser?'admin':$this->user;
		Vendor('Easemod.Easemod');
		$class=new Easemod(C('EASEMOD_APP'));
		$ret=$class->sendText($this->user,'users',[$this->touser],$this->content,['extmsg'=>'Nothing imposible! :)']);
		if(!isset($ret['error'])){
			return true;
		}else{
			$this->error=$ret;
			return false;	
		}
	}
	//预留用来获取聊天记录
	public function getChat(){
		$ql='select+*+where+timestamp>1479191463146';
		//dump($rs->chatRecord($ql));
		dump($rs->getChatRecord($ql));	
	}
}